﻿
<style type="text/css">
input[type=submit]
{
    border-radius: 5px ;
    color:white;
    background: #DC5E00;
    padding:3px;
    margin:5px;
    box-shadow: 1px 2.5px 1px #888;
    font-weight:bold;
}
input[type=submit]:hover {
    background: #AC6E00;
}
input[type=button] {
    border-radius: 5px ;
    color:white;
    background: #DC5E00;
    padding:3px;
    margin:5px;
    box-shadow: 1px 2.5px 1px #888;
    font-weight:bold;
}
input[type=button]:active
{
    box-shadow: none;
}
input[type=submit]:active
{
    box-shadow: none;
}
input[type=button]:hover {
    background: #AC5E00;
}
</style>
@Html.ValidationSummary()
<h2>Upload images for your recipe here.</h2>
<div style="display:block">
@if (Session["Images"] == null || (Session["Images"] != null && ((List<BudgetMealsModels.Entities.Image>)Session["Images"]).Count <= 6))
{
using (Html.BeginForm("AddImage", "Recipe", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.Hidden("redirectURL", (string)Request.Url.PathAndQuery)
    @:Upload image here: <input id="Image"  type="file" name="Image" />
    <input type="submit" onclick="" />
}
}
@if (Session["Images"] == null || ((List<BudgetMealsModels.Entities.Image>)Session["Images"]).Count <= 0)
{
    <p style="font-style:italic;">You have no uploaded images.</p><br />
}
else
{
    for (int i = 0; i < ((List<BudgetMealsModels.Entities.Image>)Session["Images"]).Count; i++ )
    {
    <div style="text-align:center;display:inline-block;">
        <img width="200" height="200" src="@Url.Action("Display", "Recipe", new { imageID=i})" /><br />
        <a href="@Url.Action("DeleteImage", "Recipe", new{imageID=i, redirectURL=Request.Url.PathAndQuery})">Delete</a>
    </div>
    }
    <br />
}
<div>
    @using(Html.BeginForm("FinishEditing", "Recipe", new{id = ViewBag.recipeId}))
    {
        <input type="submit" value="Finish Add/Remove Images"/>
    }
</div>
<div id="ClearFix"></div>
</div>